"""
作者：Leagolas
日期：2024年06月12日
"""
# import pandas as pd
#
# # 创建数据
# data = {'data': [1, 2, 1, 2, 1, 2, 1, 2]}
# pd_data = pd.DataFrame(data)
#
# window = 3
# # 计算滚动平方和
# pd_data['rolling_square'] = pd_data['data'].rolling(window=window).apply(lambda x: (x**2).sum())
#
# pd_data['rolling_mean'] = pd_data['data'].rolling(window=window ).sum() / window
#
# # 查看结果
# print(pd_data)


import pandas as pd

#
# a = ['none']
# def func(a):
#     a[0] = '1'
#
# func(a)
# print(a)


# print('2305'>'2212')


import pandas as pd
import numpy as np


# 假设有一个DataFrame
df = pd.DataFrame({
    'A': ['s',' s', 's'],
    'B': [5, np.nan, 7],
    'C': [9, 10, 11]
})

# 删除第一列包含缺失值的行
df_interpolated = df.interpolate(method='linear')

print(df_interpolated)